<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String contextPath = application.getContextPath();
	pageContext.setAttribute("path", contextPath);
%>
<!DOCTYPE HTML>
<html>
<head>
<jsp:include page="common_header.jsp" flush="true"></jsp:include>
<title>修改密码</title>
</head>
<body>
<article class="page-container">
  <form class="Huiform" id="changePwdForm" method="post">
  	<div class="row cl">
		<label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>旧密码：</label>
		<div class="formControls col-xs-9 col-sm-9">
			<input type="password" style="width:200px" class="input-text" value="" id="oldPwd" name="oldPassword"/>
		</div>
	</div>
  	<div class="row cl">
		<label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>新密码：</label>
		<div class="formControls col-xs-9 col-sm-9">
			<input type="password" style="width:200px" class="input-text" value="" id="newPwd" name="newPassword"/>
		</div>
	</div>
  	<div class="row cl">
		<label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>确认新密码：</label>
		<div class="formControls col-xs-9 col-sm-9">
			<input type="password" style="width:200px" class="input-text" value="" name="newPassword2"/>
		</div>
	</div>
	<div class="row cl">
		<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
			<button class="btn btn-success radius" type="submit"><i class="icon-ok"></i> 确定</button>
		</div>
	</div>
  </form>
</article>
<jsp:include page="_footer.jsp" flush="true"></jsp:include>
<script>
	
	$("#changePwdForm").validate({
		rules:{
			oldPassword:{
				required:true,
				minlength:3,
				maxlength:30
			},
			newPassword:{
				required:true,
				minlength:3,
				maxlength:30
			},
			newPassword2:{
				required:true,
				equalTo: "#newPwd",
				minlength:3,
				maxlength:30
			}
		},
		success:"valid",
		submitHandler:function(form){
			jajax({
				url:'${path}/user/changePwd.do',
				type:'post',
				data:'newPwd='+$('#newPwd').val()+'&oldPwd='+$('#oldPwd').val(),
				success:function(){
					layer.msg('修改成功!',{icon:1,time:1000});
				}
			});
		}
	});

</script>
</body>
</html>
